package ch.zbw.timeline.service;

import java.util.List;

import ch.zbw.timeline.domain.Allocation;
import ch.zbw.timeline.domain.Task;
import ch.zbw.timeline.domain.Process;

/**
 * Interface that handles the Tasks Processes and Allocations
 * The Tasks Processes and Allocations are generated and saved to the database
 * The Tasks Processes and Allocations can be read from the database
 * @author Marco
 *
 */
public interface TaskProcessAllocationService {

	
	
	/**
	 * Method to create a new Process
	 * A new process i created with the given parameters and is saved to the database
	 * @param process the name of the process
	 * @param status the status of the process (active/inactive)
	 * @return returns the created process
	 */
	public Process createProcess(String process, boolean status);

	
	
	/**
	 * Method to save or update a process to the database
	 * The given process is saved to the database
	 * @param process the given process that has to be updated or saved to the database
	 * @return returns the updated process
	 */
	public Process saveProcess(Process process);

	
	
	/**
	 * Method to get all processes that are saved in the database
	 * @return returns a list of process
	 */
	public List<Process> getAllProcesses();

	
	
	/**
	 * Method to create a new Task
	 * A new Task is created with the given parameters and is saved to the database
	 * @param task the name of the task
	 * @param status the status of the task (active/inactive)
	 * @return returns a list of task
	 */
	public Task createTask(String task, boolean status);

	
	
	/**
	 * Method to save or update a task to the database
	 * The given task is saved to the database
	 * @param task the given task that has to be updated or saved to the database
	 * @return returns the updated task
	 */
	public Task saveTask(Task task);

	
	
	/**
	 * Method to get all tasks that are saved in the database
	 * @return returns a list of task
	 */
	public List<Task> getAllTasks();

	
	
	/**
	 * Method to create a new allocation
	 * A new allocation is generated and saved to the database
	 * @param task the task that should be set to the allocation as a part of it
	 * @param process the process that should be set to the allocation as a part of it
	 * @param status the status of the allocation (active/inactive)
	 * @return allocation
	 */
	public Allocation createAllocation(Task task, Process process, boolean status);

	
	
	/**
	 * Method to save or update a allocation to the database
	 * The given allocation is saved to the database 
	 * @param allocation the allocation that has to be updated or saved
	 * @return returns the updated allocation
	 */
	public Allocation saveAllocation(Allocation allocation);

	
	
	/**
	 * Method to get all allocations that have been saved to the database so far
	 * @return returns a list of allocation
	 */
	public List<Allocation> getAllAllocations();
}
